package cn.aran.basic.controller;

import cn.aran.basic.exception.BusinessException;
import cn.aran.basic.service.ILoginService;
import cn.aran.basic.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/logout")
public class LogoutControllelr {
    @Autowired
    private ILoginService loginService;

    /**
     * @Title: logout
     * @Description: 退出登录
     * @Author: Aran
     * @Version: 1.0
     * @Date:  2022/7/12 14:15
     * @Parameters: [wechatVo]
     * @Return cn.aran.basic.utils.AjaxResult
     */
    // @PostMapping("/{token}")
    // public AjaxResult logout(@PathVariable("token") String token){
    //     try {
    //         loginService.logout(token);
    //         return AjaxResult.me();
    //     } catch (BusinessException e){
    //         e.printStackTrace();
    //         return AjaxResult.me().setSuccess(false).setMessage(e.getMessage());
    //     } catch (Exception e) {
    //         e.printStackTrace();
    //         return AjaxResult.me().setSuccess(false).setMessage("系统繁忙，请重试！");
    //     }
    // }
}
